<?php

use \Welcomescreen\Agavi\Action;

class Frontend_DeliverUploadAction extends Action\FrontendBaseAction {
	public function executeRead(AgaviWebRequestDataHolder $rd) {
		return 'Success';
	}
	
	public function validateRead(AgaviWebRequestDataHolder $rd) {
		$uploadDir = AgaviConfig::get('org.welcomescreen.system.upload_dir');
		$filePath = $uploadDir . '/' . $rd->getParameter('file');
		if(is_readable($filePath)) {
			$this->setAttribute('filePath', $filePath);
			return true;
		}
		return false;
	}
}

?>